package com.webside.points.service.impl;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.webside.points.mapper.ExpertMapper;
import com.webside.points.model.ExpertEntity;
import com.webside.points.service.ExpertService;
import com.webside.points.wechat.BeanFactory;
@Service("expertService")
public class ExpertServiceImpl implements ExpertService{

	
	@Autowired
	ExpertMapper expertMapper;
	
	public static ExpertService getInstance(){
		return (ExpertService) BeanFactory.getBean("expertService");
    }
	
	@Override
	public int insert(ExpertEntity expertEntity) {
		return expertMapper.insert(expertEntity);
	}

	@Override
	public int delete(int id) {
		return expertMapper.delete(id);
	}

	@Override
	public int updateStatus(Map<String,Integer> map) {
		return expertMapper.updateStatus(map);
	}

	@Override
	public int findCount() {
		return expertMapper.findCount();
	}

	@Override
	@Cacheable(value="ehcache")
	public List<ExpertEntity> findAll(ExpertEntity expertEntity) {
		return expertMapper.findAll(expertEntity);
	}

	@Override
	public int deleteBatch(List<Integer> ids) {
		return expertMapper.deleteBatch(ids);
	}

	@Override
	public ExpertEntity findById(int id) {
		return expertMapper.findById(id);
	}

	@Override
	public int updatePraise(ExpertEntity expertEntity) {
		return expertMapper.updatePraise(expertEntity);
	}

	@Override
	public int updateAmount(ExpertEntity expertEntity) {
		return expertMapper.updateAmount(expertEntity);
	}

	@Override
	public List<ExpertEntity> findByExpertTypeId(String expertTypeId) {
		return expertMapper.findByExpertTypeId(expertTypeId);
	}

	@Override
	public List<ExpertEntity> finaAllExpert(Map<String, Integer> map) {
		return expertMapper.finaAllExpert(map);
	}

	@Override
	public int updateTransactionId(ExpertEntity expertEntity) {
		return expertMapper.updateTransactionId(expertEntity);
	}

	@Override
	public ExpertEntity findByTransactionId(String id) {
		return expertMapper.findByTransactionId(id);
	}

	@Override
	public List<ExpertEntity> findAuditExpert(Map<String, Integer> map) {
		return expertMapper.findAuditExpert(map);
	}

	@Override
	public int update(ExpertEntity expertEntity) {
		return expertMapper.update(expertEntity);
	}

}
